﻿using UtilZ.Dotnet.Ex.Base;
using UtilZ.Dotnet.Ex.Model;

namespace UtilZ.Dotnet.Ex.Communication.Base
{
    /// <summary>
    /// 通信客户端接口
    /// </summary>
    public interface IClient : IDisposableZ
    {
        /// <summary>
        /// summary
        /// </summary>
        IClientInitPara InitPara { get; }

        /// <summary>
        /// 获取指示当前客户端与服务端口的连接状态
        /// </summary>
        bool Connected { get; }

        /// <summary>
        /// 数据Tag
        /// </summary>
        object Tag { get; set; }

        /// <summary>
        /// 获取最后一次发送数据时间戳
        /// </summary>
        long LastSendDataTimestamp { get; }

        /// <summary>
        /// 获取最后一次接收到数据的时间戳
        /// </summary>
        long LastReceiveDataTimestamp { get; }

        /// <summary>
        /// 发送数据
        /// </summary>
        /// <param name="bufferData">发送的数据</param>
        /// <param name="options">发送选项</param>
        void Send(DataSource bufferData, ISendOptions options);

        /// <summary>
        /// 发送数据
        /// </summary>
        /// <param name="data">要发送的数据对象</param>
        /// <param name="options">发送选项</param>
        void Send(TransferDataAbs data, ISendOptions options);
    }

    /// <summary>
    /// 发送选项
    /// </summary>
    public interface ISendOptions
    {

    }

    /// <summary>
    /// 发送数据选项基类
    /// </summary>
    public abstract class SendOptionsAbs : ISendOptions
    {

        /// <summary>
        /// 构造函数
        /// </summary>
        public SendOptionsAbs()
        {

        }
    }
}
